package com.ufox.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.ufox.entity.ProdDetails;
import com.ufox.entity.Products;
import com.ufox.entity.Result;
import com.ufox.service.IProdDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 优狐科技-www.hbufox.com
 * @since 2022-06-14
 */
@RestController
@RequestMapping("/prod-details")
public class ProdDetailsController {

    @Autowired
    private IProdDetailsService prodDetailsService;

    @GetMapping("/getDetailsByProdId/{prodId}")
    public Result getById(@PathVariable Integer prodId) {
        LambdaQueryWrapper<ProdDetails> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ProdDetails::getProdId,prodId);
        ProdDetails prodDetails = prodDetailsService.getOne(wrapper);
        return Result.ok(prodDetails);
    }


}

